package com.lisn.mylib.ui.sofa;

import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lisn.coordinatorlib.CoordinatorActivity;
import com.lisn.mylib.R;
import com.lisn.navannotationlib.FragmentDestination;
import com.lisn.toastlib.ToastTestActivity;
import com.lisn.toastlib.ToastUtils;


@FragmentDestination(pageUrl = "main/tabs/sofa")
public class SofaFragment extends Fragment {


    private SofaViewModel mViewModel;

    public static SofaFragment newInstance() {
        return new SofaFragment();
    }

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {


        View view = inflater.inflate(R.layout.sofa_fragment, container, false);
        view.findViewById(R.id.bt_test).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                ToastTestActivity.startActivity(getActivity());
                CoordinatorActivity.startActivity(getActivity());
            }
        });

        RecyclerView recycler_view = view.findViewById(R.id.recycler_view);

        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mViewModel = ViewModelProviders.of(this).get(SofaViewModel.class);
        // TODO: Use the ViewModel
    }

}